<template>
  <el-container style="height: 100%">
    <el-header style="background-color: #373d41">
      <div class="user-center-header">
        <el-avatar
          size="large"
          :src="this.$store.state.userInfo.loginUrlAvatar"
        ></el-avatar>
        <span class="user-center-title">博客个人中心</span>
      </div>
    </el-header>
    <el-container style="flex-direction: row; overflow-y: scroll">
      <!-- 个人中心侧边栏 -->
      <el-aside width="200px" style="background-color: #545c64">
        <div class="aside-nav">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#545c64"
            text-color="#fff"
          >
            <!-- 个人中心按钮 -->
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-s-custom"></i>
                <span>用户管理</span>
              </template>

              <!-- 个人中心路由 -->
              <router-link to="/userSetting">
                <el-menu-item>
                  <i class="el-icon-user-solid"></i>
                  个人信息
                </el-menu-item>
              </router-link>

              <!-- 用户博客信息 -->
              <router-link to="/myData">
                <el-menu-item>
                  <i class="el-icon-tickets"></i>
                  我的博客数据
                </el-menu-item>
              </router-link>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-edit-outline"></i>
                <span>博客管理</span>
              </template>
              <!-- 发布博客理由 -->
              <router-link to="/sendBlog">
                <el-menu-item>
                  <i class="el-icon-edit"></i>
                  发布博客
                </el-menu-item>
              </router-link>

              <router-link to="/showUserBlog">
                <el-menu-item>
                  <i class="el-icon-view"></i>
                  查看博客
                </el-menu-item>
              </router-link>
              <router-link to="/showFavoriteBlog">
                <el-menu-item>
                  <i class="el-icon-star-on"></i>
                  收藏夹
                </el-menu-item>
              </router-link>
            </el-submenu>

            <!-- 转跳首页 -->
            <router-link to="/index">
              <el-menu-item index="1-1">
                <i class="el-icon-s-home"></i>
                <span>首页</span>
              </el-menu-item>
            </router-link>
          </el-menu>
        </div>
      </el-aside>
      <!-- 个人中心主体 -->
      <el-main style="height: 100%; background-color: #eaedf1">
        <!-- 路由站位给 每个侧边栏点击展示 -->
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: "userCenter",
  data() {
    return {};
  },
  methods: {
    handleOpen(key, keyPath) {
      //console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      //console.log(key, keyPath);
    },
  },
  mounted() {},
};
</script>

<style scoped lang="scss">
* {
  text-decoration: none;
}
.user-center-header {
  height: 100%;
  display: flex;
  align-items: center;
  margin-left: 10px;
  .user-center-title {
    margin-left: 5px;
    font-size: 20px;
    color: #fff;
  }
}

.user-center-main {
  padding: 20px;
  text-align: center;
  font-size: 28px;
}

.aside-nav {
  .el-menu {
    border: none;
    border-right-width: 0;
  }
}
</style>
